<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
    <style type="text/css">
        body {
            padding-top: 30px;
        }

        .open-app {
            margin: 30px;
            border-radius: 5px;
            padding: 10px 20px;
            border: 1px solid #ccc;
        }
    </style>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
</head>

<body>
    <a class="open-app">唤醒APP</a>
    <script type="text/javascript">
        $('a').click(function () {
            var u = navigator.userAgent;
            var isWeixin = u.toLowerCase().indexOf('micromessenger') !== -1; // 微信内
            var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //android终端
            var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
            console.log();
            // 微信内
            if (isWeixin) {
                alert('请在浏览器上打开')
            } else {
                //android端
                if (isAndroid) {
                    //安卓app的scheme协议
                    window.location.href = 'dzzd//:app?link=messageDetail&id=1';
                    setTimeout(function () {
                        let hidden = window.document.hidden || window.document.mozHidden || window
                            .document.msHidden || window.document.webkitHidden
                        if (typeof hidden == "undefined" || hidden == false) {
                            //下载地址
                            window.location.href = "https://xiu.qhczy.com/dzyjcf/";
                        }
                    }, 2000);
                }
                //ios端
                if (isIOS) {
                    // Universal Link
                    window.location.href = 'dzzd//:app?link=messageDetail&id=1'
                
                }
            }

        });
    </script>
</body>

</html>